package com.mdd.admin.validate.pay;

import com.mdd.admin.vo.pay.DevPayConfigVo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.DecimalMin;
import javax.validation.constraints.NotNull;
import java.io.Serializable;

/**
 * 支付配置参数
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@ApiModel(value = "支付配置请求对象", description = "支付配置请求对象")
public class DevPayParam implements Serializable {

    private static final long serialVersionUID = 1L;

    public interface create {
    }

    public interface update {
    }

    public interface delete {
    }

    @ApiModelProperty(value = "id")
    @NotNull(message = "id参数必传且需大于0", groups = {update.class, delete.class})
    private Long id;

    @ApiModelProperty(value = "支付名称")
    @NotNull(message = "name参数缺失", groups = {create.class, update.class})
    @Length(max = 32, message = "name参数不能超出32个字符", groups = {create.class, update.class})
    private String name;

    @ApiModelProperty(value = "支付方式:1-微信支付;2-支付宝支付;3-余额支付;")
    @NotNull(message = "payWay参数缺失", groups = {create.class, update.class})
    @DecimalMin(value = "0", message = "payWay参数值不能少于0", groups = {create.class, update.class})
    private Integer payWay;

    @ApiModelProperty(value = "配置")
    private DevPayConfigVo config;

    @ApiModelProperty(value = "图片")
    @NotNull(message = "image参数缺失", groups = {create.class, update.class})
    @Length(max = 255, message = "image参数不能超出255个字符", groups = {create.class, update.class})
    private String image;

    @ApiModelProperty(value = "排序")
    @NotNull(message = "sort参数缺失", groups = {create.class, update.class})
    @DecimalMin(value = "0", message = "sort参数值不能少于0", groups = {create.class, update.class})
    private Integer sort;

}
